/*
 * Created: Author: Aléx Carvalho / Date: Jan 23, 2015
 * 
 * Changed: $Author: ac280593@gmail.com $ / $Date: 2015-03-13 07:38:16 -0300 (Sex, 13 mar 2015) $
 */
package com.cpm.entities.converters;

import com.cpm.entities.types.Family;
import javax.persistence.AttributeConverter;
import javax.persistence.Converter;

@Converter(autoApply = true)
public class FamilyPersistenceConverter implements AttributeConverter<Family, Integer> {

    @Override
    public Integer convertToDatabaseColumn(Family attribute) {
        return TypeConverter.getId(attribute);
    }

    @Override
    public Family convertToEntityAttribute(Integer dbData) {
        return TypeConverter.convertTo(Family.class, dbData);
    }
    
}